package com.ddwl.gate.domain.gaode.controller;


import com.ddwl.common.annotation.Auth;
import com.ddwl.common.controller.BaseController;
import com.ddwl.gate.domain.gaode.api.vo.PoiVo;
import com.ddwl.gate.domain.gaode.service.GaoDeService;
import com.ddwl.gate.domain.gaode.vo.QueryGaoDePoiVo;
import com.ddwl.schema.vo.base.RestVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;


@Api(tags = "高德周边查询服务")
@RequestMapping("/gaode")
@RestController
public class GaodeController extends BaseController {

    @Resource
    private GaoDeService gaoDeService;

    @PostMapping("/queryPoi")
    @Auth(required = false)
    @ApiOperation("查询高德周边信息")
    public RestVo<List<PoiVo>> queryPoi(@RequestBody QueryGaoDePoiVo  bo) {
        return RestVo.ok(gaoDeService.queryPoi(bo));
    }

    @PostMapping("/place")
    @Auth(required = false)
    @ApiOperation("查询高德周边信息")
        public RestVo place(@RequestParam String cityName) {
        gaoDeService.place(cityName);
        return RestVo.ok();
    }

}
